/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package eproject.utilitity;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 *
 * @author khiemtd
 */
public class DateUtils {

    public static Date convertStringToDate(String input, String pattern) throws ParseException {
        SimpleDateFormat sdf = new SimpleDateFormat(pattern);
        return sdf.parse(input);
    }
    public static String convertDateToString(Date input, String pattern){
        DateFormat df = new SimpleDateFormat(pattern);
        return df.format(input);
    }
}
